How to create a simple stopwatch using JavaScript